<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

use App\Http\Controllers\Web\NewsController;
use App\Http\Controllers\Web\ProductsCategoriesController;
use App\Http\Controllers\Web\PagesController;
use App\Http\Controllers\AuthController;
use App\Http\Controllers\Web\CasesController;
use App\Http\Controllers\Web\CompanyController;
use App\Http\Controllers\Web\WebSiteConfigController;
use App\Http\Controllers\Web\UsersController;
use App\Http\Controllers\Web\CompanyDevelopmentHistoryController;
use App\Http\Controllers\Web\FileController;
use App\Http\Controllers\Web\BannersController;
use App\Http\Controllers\Web\ProductsController;
use App\Http\Controllers\Web\ProjectsController;
use App\Http\Controllers\Web\ContactsController;
use App\Http\Controllers\Web\BuildTypeController;

Route::group(['prefix' => 'api'], function () {
    // 新闻
    Route::resource('news', NewsController::class);
    Route::get('news/viewVolume/{id}', [NewsController::class, 'viewVolume']);
    // 产品分类
    Route::resource('productsCategories', ProductsCategoriesController::class);
    // 产品列表
    Route::resource('products', ProductsController::class);
    // 页面
    Route::resource('pages', PagesController::class);
    // 案例
    Route::resource('case', CasesController::class);
    Route::get('case/viewVolume/{id}', [CasesController::class, 'viewVolume']);
    // 轮播图
    Route::resource('banners', BannersController::class);
    Route::resource('contacts', ContactsController::class);
    // 产品项目
    Route::resource('projects', ProjectsController::class);
    // 建筑类型
    Route::resource('buildType', BuildTypeController::class);
    // 发展历史
    Route::resource('companyDevelopmentHistory', CompanyDevelopmentHistoryController::class);
    // 公司信息
    Route::get('company', [CompanyController::class, 'index']);
    Route::post('company', [CompanyController::class, 'update']);
    // 站点信息
    Route::get('webSite', [WebSiteConfigController::class, 'index']);
    Route::post('webSite', [WebSiteConfigController::class, 'update']);
    Route::post('register', [AuthController::class, 'register']);
    Route::post('login', [AuthController::class, 'login']);
    Route::post('logout', [AuthController::class, 'logout']);
    Route::post('refresh', [AuthController::class, 'refresh']);
    Route::get('user', [AuthController::class, 'user']);
    Route::resource('users', UsersController::class);
    Route::post('uploadImg', [FileController::class, 'uploadImg']);
    Route::get('getImg', [FileController::class, 'getImg']);
    // 基础地址
    Route::get('getBasePath', [FileController::class, 'getBasePath']);
});



